package com.thghh.ch5.tree;

/**
 * @author Zhikang.Peng
 * @version 1.0
 * @email thghh@qq.com
 * @date 2020/9/10 10:14
 */
public class Traverse {

    public static void traverse(BinNode rt) {
        if(rt == null) return;
        if(rt.isLeaf()) System.out.print(rt.element());
        else {
            System.out.print(rt.element());
            traverse(rt.left());
            traverse(rt.right());
        }
    }
}
